//
//  UserData.swift
//  SwiftProject
//
//  Created by HBY on 2021/5/6.
//

import UIKit

class UserData: NSObject {
    static let shared = UserData()
    @objc dynamic var info:String? = nil
    
    private override init() {
        super.init()
        print("初始化")
        
        info = "000000"
    }
    
    init(text:String) {
        info = text
        print("初始化====\(text)")
    }
    
    public func show(_ name:String){
        print("你好，我是\(name)")
    }
    
    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
        print("1监听通知!")
    }
}

enum Method:Int {
    case one = 1
    case two = 2,three
}

struct MyStruct {
    let valueKey = "this is a struct"
    var age = 34
    
    func printStr(){
        print("\(valueKey),age:\(age)")
    }
}
